import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import replace from "@rollup/plugin-replace";

export default [
  {
    input: "modules/React.js",
    /** @type {import("rollup").OutputOptions} */
    output: {
      name: "React",
      file: "debug/react.js",
      format: "umd",
      sourcemap: true,
    },
    /** @type {import('rollup').Plugin[]} */
    plugins: [
      resolve(),
      commonjs(),
      replace({
        sourceMap: true,
        preventAssignment: true,
        "process.env.NODE_ENV": JSON.stringify("development"),
      }),
    ],
  },
  {
    input: "modules/ReactDOM.js",
    /** @type {import("rollup").OutputOptions} */
    output: {
      name: "ReactDOM",
      file: "debug/react-dom.js",
      format: "umd",
      sourcemap: true,
    },
    /** @type {import('rollup').Plugin[]} */
    plugins: [
      resolve(),
      commonjs(),
      replace({
        sourceMap: true,
        preventAssignment: true,
        "process.env.NODE_ENV": JSON.stringify("development"),
      }),
    ],
  },
];
